﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyMES.Domain.zyy;
using MyMES.Error;
using MyMES.Writer.API.Application.CommendHandlers.Inventorylists;

namespace MyMES.Writer.API.Controllers.Inventorylists
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class InventorylistsController : ControllerBase
    {
        private readonly IMediator med;

        public InventorylistsController(IMediator med)
        {
            this.med = med;
        }
        [HttpPost]
        public async Task<APIResult<Inventorylist>> Handle(AddInverlistcommand request, CancellationToken cancellationToken)
        {
            return await  med.Send(request, cancellationToken);
        }
    }
}
